import React, { useEffect, useState } from 'react'

export default function App() {
    const [mun, setMun] = useState(0);
    const [isHot, setIsHot] = useState(true);
    
    useEffect(() => {
        console.log("isHot执行了");
        return () => {

            console.log(mun);
        }
    }, [mun, isHot])


    useEffect(() => {
        console.log('count执行了');
    }, [mun])
    return(
        
            <div>
               <h1>count的值是{count}</h1>
          <button onClick={() => { setMun(count + 1) }}>累加</button>
    
          <hr />
    
          <h1>今天的天气真{isHot ? "晴朗" : "下雨"}</h1>
          <button onClick={() => { setIsHot(!isHot) }}>修改天气</button> 
            </div>
        
    )
            
}
